package com.ctshk.rpc.order.goods.mapper;

import com.ctshk.rpc.order.goods.base.CustomBaseMapper;
import com.ctshk.rpc.order.goods.entity.RegionalFreight;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 地区运费表 Mapper 接口
 * </p>
 *
 * @author 黄利斌
 * @since 2021-04-09
 */
public interface RegionalFreightMapper extends CustomBaseMapper<RegionalFreight> {

    /**
     * 查询地区运费模板
     * @param freightTemplateId
     * @param regionId
     * @return
     */
    @Select({
            "SELECT  id,template_id,region_id,region_name,first_article,freight_amount,continuation,renew_amount,create_id,modified_id,is_deleted,gmt_create,gmt_modified  " +
                    "FROM `ctshk-goods`.t_regional_freight     " +
                    "WHERE (template_id = #{freightTemplateId} AND region_id = #{regionId})"
    })
    RegionalFreight selectRegionalFreightByTemplateIdAndRegionId(@Param("freightTemplateId") Long freightTemplateId,@Param("regionId") Long regionId);
}
